﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UAXInversionesWeb
{
    public partial class PPCliente : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // control para ver si está logueado
            if (HttpContext.Current.Session["logueado"] == null || (int)HttpContext.Current.Session["logueado"] == 0)
            {
                Response.Redirect("../default.aspx",false);
            }
            
            usuarioLogueado.Text = (string)HttpContext.Current.Session["userName"];

            if (HttpContext.Current.Session["ultimoLogin"] != null)
            {
                LabelUltimoLogin.Text =  ((DateTime)HttpContext.Current.Session["ultimoLogin"]).ToString("HH:mm dd-MM-yyyy");
            }
            else
            {
                LabelUltimoLogin.Text = "nah";
            }
                
            
        }

        /// <summary>
        /// asigna un título a la ventana
        /// </summary>
        public string mainTitle
        {
            set
            {
                pageTitle.Text = value;
            }
        }

    }
}
